<html>
<head>
    <meta charset="utf-8">
    <title>Mocha Tests</title>
    <link href="https://cdn.rawgit.com/mochajs/mocha/2.2.5/mocha.css" rel="stylesheet" />
</head>
<body>

<div style="font: 20px/1.5 'Helvetica Neue',Helvetica,Arial,sans-serif; margin: 60px 50px;">
    AccessToken:
    <input type="text" id="accesstoken">
    <button onclick="run()">Run</button>
</div>
<div id="mocha"></div>

<script src="https://cdn.rawgit.com/jquery/jquery/2.1.4/dist/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/Automattic/expect.js/0.3.1/index.js"></script>
<script src="https://cdn.rawgit.com/mochajs/mocha/2.2.5/mocha.js"></script>
<script src="http://chaijs.com/chai.js"></script>
<script src="../lib/CRMWebAPI.js"></script>

<script></script>
<script>
    jQuery.loadScript = function (url, callback) {
        jQuery.ajax({
            url: url,
            dataType: 'script',
            success: callback,
            async: true
        });
    }

    function run() {
        mocha.setup({
            ui: 'bdd',
            timeout: 500000
        });
        $.loadScript('test.browser.js', function(){
            mocha.checkLeaks();
            mocha.globals(['jQuery']);
            mocha.run();
        });
    }
</script>
</body>
</html>
